package plus;

public class S_Array extends Solution {
	public Type range;
	public S_Array(Type range) {
		this.range = range;
	}
	@Override void conform_to(Solution that, Gamma gamma) {
		range.conform_to(((S_Array)that).range, gamma);
	}
	@Override public void unify_with(Solution that) {
		range = Type.unify(range, ((S_Array)that).range);
	}
	@Override Solution copy() { return new S_Array(Type.variable()); }
	@Override Type subst(Type[] actuals) { return Type.fresh(new S_Array(range.chase().subst(actuals))); }
	@Override boolean isNullable() { return false; }
	@Override boolean canConform(Solution that, Hypo h) {
		return Type.canConform(range, ((S_Array)that).range, h);
	}
	@Override public String toString() { return "array[] of "+range.toString(); }
}
